<template>
  <el-dialog  :title="$t('page.form.applicationfordrawback')" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
    <el-form :gutter="24" @submit.native.prevent ref="search-box" label-position="left" label-width="150px">
      <el-form-item  :label="$t('page.form.platformnumber')" size="mini">
        <span>{{form.tradeNo}}</span>
      </el-form-item>
      <el-form-item  :label="$t('page.form.refundamount')" size="mini">
        <span>{{form.mchTransCurrency}} {{form.mchTransAmount}}</span>
      </el-form-item>
      <el-form-item  :label="$t('page.form.refundreason')" size="mini">
        <el-input placeholder="" v-model="form.transReason"  clearable></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <!-- <el-button @click="close" size="small">{{
        $t("page-trade-detail.dialog-email.close")
      }}</el-button> -->
      <el-button @click.prevent="close" size="small">{{ $t('page.form.submit') }}</el-button>
      <el-button @click.prevent="submit" type="primary" size="small">{{ $t('page.form.confirm') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import ApiMain from "@/api/trade.refund";
export default {
  mixins: [],
  props: [],
  data() {
    return {
      dialogVisible: false,
      data: null,
      form: {},

      id: null,
    };
  },
  methods: {
    show(form = {}) {
      this.form.orderId = form.id;
      this.form.tradeNo = form.tradeNo
      this.form.mchTransCurrency = form.mchTransCurrency
      this.form.mchTransAmount = form.mchTransAmount / 100
      form.transReason=""
      this.fetchData();
      this.dialogVisible = true;
    },

    close() {
      this.dialogVisible = false;
      this.$emit("dialog-close");
    },
    async submit() {
      let data = await ApiMain.add(this.form)
      this.close()
    },
    fetchData() {
    },

    renderData() { },
  },
};
</script>